package com.noahplat.person.feign;

import com.noahplat.common.utils.Result;
import com.noahplat.person.pojo.Person;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Set;

/**
 * @InterfaceName: PersonFeign
 * @Description: 人员对外feign
 * @Author 李景星
 * @Date 2021/3/5
 * @Version 1.0
 */
@FeignClient(name = "person", contextId = "personFeign")
public interface PersonFeign {

    /**
     * 注册账号时，初始化人员
     *
     * @param userId
     * @return
     */
    @PostMapping("/api/person/initPerson")
    Result initPerson(@RequestParam("userId") Long userId);

    /**
     * 获取uid
     * 宋彦磊
     */
    @GetMapping("/api/person/getUid")
    public Result getUid(@RequestParam("pid") Long[] pid, @RequestHeader("Authorization") String token);

    /**
     * 更新人员
     *
     * @param person
     * @return
     */
    @PutMapping("/api/person/updatePerson")
    public Result updatePerson(@RequestBody Person person);

    /**
     * 根据账户ID更新人员所属账套
     *
     * @param acctid
     * @param uid
     * @return
     */
    @PutMapping("/api/person/updateAcctidByUid")
    public Result updateAcctidByUid(@RequestParam("acctid") Long acctid, @RequestParam("uid") Long uid);
}
